package crawl;

import java.net.URI;

/**
 * A filter for <code>URI</code>.
 * 
 * @author huangcd
 */
public interface URIFilter
{
    /**
     * Tests whether or not the specified <code>URI</code> should be included in
     * a list.
     * 
     * @param uri
     *            The <code>URI</code> to be tested
     * @return <code>true</code> if and only if <code>uri</code> should be
     *         included
     */
    public boolean accept(URI uri);

    /**
     * normalize the {@code newURI} using a {@code oldURI}.
     * 
     * @param oldURI
     *            an original uri
     * @param newURI
     *            a new uri based on the {@code oldURI}
     * @return the standard form of the newURI based on the {@code oldURI}
     */
    public URI normalize(URI oldURI, URI newURI);
}
